//
//  ViewController.m
//  UI_Homework_07_01
//
//  Created by 黄威 on 16/5/11.
//  Copyright © 2016年 黄威. All rights reserved.
//

#import "ViewController.h"
#import "SecondViewController.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self createRedView];


}



- (void)createRedView{

    UIView *redview = [[UIView alloc]init];
    redview.backgroundColor = [UIColor redColor];
    redview.frame = self.view.frame;
    [self.view addSubview:redview];
    [redview release];
     self.title = @"第一页";
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(handleleft)];

    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemSearch target:self action:@selector(handleright)];
    
    
    
}

- (void)handleft{

}
- (void)handleright{

    SecondViewController *second = [[SecondViewController alloc]init];
    
    [self.navigationController pushViewController:second animated:YES];

    [second release];

}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
